<?php

use Illuminate\Database\Seeder;

class Env_infoSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $faker = \Faker\Factory::create('zh_CN');
        for($i = 0; $i < 100; $i++){
            DB::table('env_info') -> insert([

         'temperature' 	=> $faker->randomFloat(5, 10, 40),
         'air_humidity'	=> $faker->randomFloat(5, 0, 0.5),
        'soil_humidity'	=> $faker->randomFloat(5, 0, 0.5),
        'light_intensity'	=> $faker->randomFloat(5, 0.4, 0.7),
        'co2'		=>$faker->numberBetween(200, 400),
        'shed_id'	=> rand(1,5),
        'created_at'=> date('Y-m-d H:i:s')
    ]);
}
    }
}
